package com.yang.spring.ribbon.controller;

import com.yang.spring.ribbon.service.ApiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.client.RestTemplate;

/**
 * Created by zziahui on 16/11/15.
 */
@org.springframework.web.bind.annotation.RestController
public class RestController {

    @Autowired
    private ApiService apiService;

    @RequestMapping(value="/test")
    @ResponseBody
    public String test(@RequestParam String name){
        return apiService.sayHelloTo(name);
    }

}
